package eco2automotive.gui;
import javax.swing.*;
/**  
  * Display a confirm message box
  * @version 1.0
  * @autor Fco. Javier Sánchez Esparza
  *
  */ 
public class ConfirmAlert extends JOptionPane{
		String tit;
		String desc;
  /** 
* Constructor
     * @param title 
     * @param desc , the message
    */
public ConfirmAlert(String title, String desc){
			this.tit=title;
			this.desc=desc;                        

}
  /** 
     * Display the cofirm message box
     * @return 1=Yes, 0=No
    */
public int showme(){        
int selected= JOptionPane.showConfirmDialog(new JPanel(),desc,tit,JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE); 
if(selected ==JOptionPane.YES_OPTION ){
selected=1;
}    
else{
 selected=0;   
}
return selected;
}
}